package com.vrms.app.service.impl;

import com.vrms.app.dao.DoctorDao;
import com.vrms.app.entity.Doctor;
import com.vrms.app.service.DoctorService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class DoctorServiceImpl implements DoctorService {
    @Resource
    private DoctorDao doctorDao;

    @Override
    public List<Doctor> listPage(int page, int size, String username) {
        return doctorDao.listPage((page-1)*size,size,username);
    }

    @Override
    public int count(String username) {
        return doctorDao.count(username);
    }

    @Override
    public boolean save(Doctor doctor) {
        return doctorDao.save(doctor)>0;
    }

    @Override
    public boolean update(Doctor doctor) {
        return doctorDao.update(doctor)>0;
    }

    @Override
    public boolean remove(int id) {
        return doctorDao.remove(id)>0;
    }

    @Override
    public List<Doctor> list() {
        return doctorDao.list();
    }
}
